﻿using Abp.Domain.Entities;
using shenghua.Basics;
using shenghua.Common.CustomValueType;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace shenghua.Order.Orders
{
    public class OrderDetail: Entity, IExtendableObject
    {
        public int OrderId { get; set; }
        public string OrderNumber { get; set; }
        public int CommodityId { get; set; }
        public long MemberId { get; set; }
        public int? ShoppingOptionId { get; set; }
        public string CommodityName { get; set; }
        public string CommodityPicture { get; set; }
        public int Count { get; set; }
        public Money Price { get; set; }
        public int XPValue { get; set; }
        public Money OriginalPrice { get; set; }
        public Money TotalAmount { get; set; }
        public Dictionary<string, string> ShoppingOptionParameters
        {
            get
            {
                return this.GetData<Dictionary<string, string>>("shoppingoptionparameters");
            }
        }
        public InventoryDeductionType InventoryDeductionType { get; set; }

        public string ExtensionData { get; set; }

        public OrderDetail()
        {
            Price = new Money();
            OriginalPrice = new Money();
            TotalAmount = new Money();
            SetShoppingOptionParameters(new Dictionary<string, string>());
        }

        public void SetShoppingOptionParameters(Dictionary<string, string> shoppingOptionParameters)
        {
            this.SetData("shoppingoptionparameters", shoppingOptionParameters);
        }
    }
}
